package net.eascn.flowerThief.utils
{
	import com.adobe.xml.syndication.atom.Entry;
	
	import flash.system.System;
	
	import mx.controls.Alert;
	
	public class PhotoUtil
	{
		public function PhotoUtil()
		{
		}

		public static function parseEntrys($entrys:Array):void
		{
			var conts:Array = [];
			var thumbs:Array = [];
			
			for each(var data:Entry in $entrys)
				{
					 var list:XMLList = (data  as Entry).xml;
					var xml:XML = list[0];
					var mediaNS:Namespace = new Namespace("media", "http://search.yahoo.com/mrss/");
           			var groupQUanem:QName= new QName(mediaNS, "group");
					var thumbQname:QName = new QName(mediaNS,'thumbnail');
					var content:QName  = new QName(mediaNS,'content');
					var group:XML = xml.elements(groupQUanem)[0];
					
					var thumbss:String= group.elements(thumbQname)[0].@url;
					var contss:String= group.elements(content)[0].@url;
					
					thumbss = '<img src="'+thumbss+'">';
					contss = '<img src="'+contss+'">';
					
					conts.push(contss);
					thumbs.push(thumbss);
				}
			
			var str:String= '';
			while(thumbs.length>0)
			{
				str += thumbs.shift();
			}
			
			str +='<!--more-->';
			while(conts.length>0)
			{
				str += conts.shift();
			}
			
			System.setClipboard(str);
			
			Alert.show('copy!!');
		
		}		
	}
}